﻿#ifndef BINARYRAINWIDGET_H
#define BINARYRAINWIDGET_H

#include <QWidget>
#include <QVector>
#include <QTimer>
#include <QString>

class BinaryRainWidget : public QWidget {
    Q_OBJECT

public:
    explicit BinaryRainWidget(QWidget *parent = nullptr);
    ~BinaryRainWidget() override;

    void initializeColumns();
protected:
    void paintEvent(QPaintEvent *event) override;
    void resizeEvent(QResizeEvent *event) override;

private slots:
    void updateRain();

private:
    struct RainColumn {
        QVector<QChar> chars;
        QVector<int> yPositions;
        QVector<QColor> colors;
        int speed;
        bool isActive;
    };

    QVector<RainColumn> columns;
    QTimer *timer;
};

#endif // BINARYRAINWIDGET_H
